<script setup>
import {useMenuTreeStore} from "@/stores/menuTreeStore.js";
import {addMenuRouter} from "@/utils/routerUtils.js";
import {LOCAL, SESSION} from "@/utils/catch.js";
import {useNowRouterStore} from "@/stores/nowRouterStore.js";
import {useRouter} from "vue-router";

const menuTreeStore = useMenuTreeStore()
const nowRouterStore = useNowRouterStore()
const r = useRouter()
if (LOCAL.get('token') && SESSION.get('userLoginStatus')){
  console.log('恢复路由')
  addMenuRouter(menuTreeStore,r)
}
if(!SESSION.get('userLoginStatus')){
  menuTreeStore.menuTree = []
  nowRouterStore.clean()
}
</script>

<template>
  <router-view />
</template>


<style scoped>

</style>
